package com.ld.Impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.ld.mapper.UserMapper;
import com.ld.pojo.User;
import com.ld.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserMapper userMapper;

	//1. 添加用户
	@Override
	public void add(User user) {
		userMapper.insert(user);
		System.out.println("user.getId() = " + user.getId());

	}

	//2. 列表用户
	@Override
	public List<User> findAll() {
		return userMapper.selectList(null);
	}
}
